package com.ftwj.controller;

import com.ftwj.entity.SysMenu;
import com.ftwj.service.SysRoleMenuService;
import com.ftwj.vo.MenuVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/role-menu")
public class SysRoleMenuController {
    @Autowired
    private SysRoleMenuService sysRoleMenuService;

    @PostMapping("/assign")
    public void assignMenusToRole(@RequestBody Map<String, Object> requestBody) {
        String roleId = (String) requestBody.get("roleId");
        List<String> menuIds = (List<String>) requestBody.get("menuIds");

        sysRoleMenuService.assignMenusToRole(roleId, menuIds);
    }

}
